<template>
	<view style="padding: 30rpx;">
		<button @click="onLog()">console.log</button>
		<button @click="onDebug()">console.debug</button>
		<button @click="oninfo()">console.info</button>
		<button @click="onwarn()" type="warn">console.warn</button>
		<button @click="onError()" type="warn">console.error</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'打印日志',
				name:'lvqiang',
				pwd:'222'
			}
		},
		methods: {
			onLog(){
				console.log(""+this.title);
				console.log("clog");
				// clog
				console.log('this.title: ',this.title);
			},
			onDebug(){
				const debugMsg = '调试信息：用户正在测试debug日志';
								console.debug(debugMsg);
								console.debug('调试变量：', this.pwd); 
			},
			oninfo(){
					const infoMsg = '信息提示：操作已完成';
								const systemInfo = `系统信息：当前用户${this.name}，状态正常`;
								
								console.info(infoMsg);
								console.info(systemInfo);
								},
			
			
			
			onwarn(){
				if(this.name==='lvqiang'){
					console.log("登陆验证成功");
				}else{
					console.warn("this is warn log");
				}
			},
			onError() {
							const errorMsg = '错误信息：操作失败';
							console.error(errorMsg);
							
							try {
								console.log(nonExistentVariable);
							} catch (e) {
								const catchMsg = `捕获到错误：${e.message}`;
								console.error(catchMsg);
								
							}
							
						}
			
		}
	}
</script>

<style>

</style>
